package com.example.literaturesystem.controller.publisher;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.example.literaturesystem.domain.publisher.CNPublisher;
import com.example.literaturesystem.service.publisher.ICNPublisherService;
import com.google.gson.Gson;

/**
*@author LMR
*@data 2018年1月31日下午10:05:42
*/
@RestController
@RequestMapping("/publisher")
public class PublisherController {
	
	@Autowired ICNPublisherService cnPublisherService;
	
	@RequestMapping(method = RequestMethod.GET)
	public String get(){
		
		List<CNPublisher> cnlist = this.cnPublisherService.query(new CNPublisher());
		System.out.println(cnlist.get(0).getCityID());
		Gson gson = new Gson();
	    return gson.toJson(cnlist);
	}
	
	
}
